<html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>橘子屋</title>
    <link rel="stylesheet" type="text/css" href="/backpage/css/shoujidd_sj.css">
    <link rel="stylesheet" type="text/css" href="/backpage/css/tongyongbao.css">
    <script src="/backpage/js/tongyongbao.js" type="text/javascript" charset="utf-8"></script><meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">
    <script src="/backpage/js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
    <style>
.pagination li{
  width: 25%;
    float: left;
    height: 4rem;
    line-height: 4rem;
    text-align: center;

    font-size: 1.6rem;
}
.pagination li a{color: #5e5e5e;}
    </style>
</head>
<body>
<header>
    橘子屋-线上订单
</header>
<div class="xsdd_one">
    <div class="xsdd_tb action">待确认</div>
    <div class="xsdd_tb">待付款</div>
    <div class="xsdd_tb">待发货</div>
    <div class="xsdd_tb">取消</div>
</div>
<div class="xsdd_two">
    <div class="dai_qr" style="display: block;">
        <table border="1" cellpadding="0" cellspacing="0" class="yhlb">
            <tbody><tr>
                <td>用户名</td>
                <td>联系方式</td>
                <td>下单时间</td>
                <td>订单详情</td>
            </tr>
            </tbody><tbody id="tbody1">
              @foreach($pageList as $row)
              <tr class="yonghu_sj">
                <td>{{$row->address->name}}</td>
                <td>{{$row->address->mobile}} </td>
                <td>{{$row->created_at->toDateString()}}</td>
                <td>
                  <a href="/admin/order/detail?id={{$row->id}}">
                  <div class="xiangqing"><img src="/backpage/images/xiangqingtb.png" width="25" height="25" style="position: relative;top: -4px;">
                  </div>
                  </a>
                </td>
              </tr>
@endforeach
            </tbody>
        </table>
        <div class="fenye1">
          <div class="fenye4">
          {{ $pageList->links('common.paginator', [ 'results'=>$pageList ]) }}
          </div>
        </div>
        </div>
    <div class="dai_qr" style="display: none;">
        <table border="1" cellpadding="0" cellspacing="0" class="yhlb">
            <tbody><tr>
                <td>用户名</td>
                <td>联系方式</td>
                <td>下单时间</td>
                <td>订单详情</td>
            </tr>
          </tbody><tbody id="tbody2">@foreach($pageList1 as $row)
            <tr class="yonghu_sj">
              <td>{{$row->address->name}}</td>
              <td>{{$row->address->mobile}} </td>
              <td>{{$row->created_at->toDateString()}}</td>
              <td>
                <a href="/admin/order/detail?id={{$row->id}}">
                <div class="xiangqing"><img src="/backpage/images/xiangqingtb.png" width="25" height="25" style="position: relative;top: -4px;">
                </div>
                </a>
              </td>
            </tr>
@endforeach</tbody>
        </table>
        <div class="fenye4">
        {{ $pageList->links('common.paginator', [ 'results'=>$pageList1 ]) }}
        </div>
      </div>


    <div class="dai_qr" style="display: none;">
        <table border="1" cellpadding="0" cellspacing="0" class="yhlb">
            <tbody><tr>
                <td>用户名</td>
                <td>联系方式</td>
                <td>下单时间</td>
                <td>订单详情</td>
            </tr>
          </tbody><tbody id="tbody3">@foreach($pageList2 as $row)
            <tr class="yonghu_sj">
              <td>{{$row->address->name}}</td>
              <td>{{$row->address->mobile}} </td>
              <td>{{$row->created_at->toDateString()}}</td>
              <td>
                <a href="/admin/order/detail?id={{$row->id}}">
                <div class="xiangqing"><img src="/backpage/images/xiangqingtb.png" width="25" height="25" style="position: relative;top: -4px;">
                </div>
                </a>
              </td>
            </tr>
@endforeach</tbody>
        </table>
        <div class="fenye4">
        {{ $pageList->links('common.paginator', [ 'results'=>$pageList2 ]) }}
        </div>
    </div>


    <div class="dai_qr" style="display: none;">
        <table border="1" cellpadding="0" cellspacing="0" class="yhlb">
            <tbody><tr>
                <td>用户名</td>
                <td>联系方式</td>
                <td>下单时间</td>
                <td>订单详情</td>
            </tr>
          </tbody><tbody id="tbody4">@foreach($pageList3 as $row)
            <tr class="yonghu_sj">
              <td>{{$row->address->name}}</td>
              <td>{{$row->address->mobile}} </td>
              <td>{{$row->created_at->toDateString()}}</td>
              <td>
                <a href="/admin/order/detail?id={{$row->id}}">
                <div class="xiangqing"><img src="/backpage/images/xiangqingtb.png" width="25" height="25" style="position: relative;top: -4px;">
                </div>
                </a>
              </td>
            </tr>
@endforeach</tbody>
        </table>
        <div class="fenye4">
{{ $pageList->links('common.paginator', [ 'results'=>$pageList3 ]) }}
        </div>
    </div>

    <input type="hidden" id="now1" value="1" pgs="" style="display: none;">
    <input type="hidden" id="now2" value="1" pgs="" style="display: none;">
    <input type="hidden" id="now3" value="1" pgs="" style="display: none;">
    <input type="hidden" id="now4" value="1" pgs="" style="display: none;">


</div>
<a href="/admin">
    <footer>
        返回首页
    </footer>
</a>


<script type="text/javascript">
    $(".xsdd_tb").click(function () {
            $(this).addClass("action").siblings().removeClass("action");
            var index = $(this).index();
            $(".dai_qr").eq(index).show().siblings().hide();
        }
    );</script>

<script>

    $(function () {
        var info1 = {pageNo: 1, pageSize: 10, orderStatus: 0, shopStatus: 0};	//未确认
        var info2 = {pageNo: 1, pageSize: 10, orderStatus: 1, shopStatus: 0};	//待付款
        var info3 = {pageNo: 1, pageSize: 10, orderStatus: 1, shopStatus: 1};	//待发货
        var info4 = {pageNo: 1, pageSize: 10, orderStatus: 7};	//已取消
        var url = "/order/getAdminOrderOnline";
/*
        send_post0(url, info1);
        send_post1(url, info2);
        send_post2(url, info3);
        send_post3(url, info4);*/
    })

    //待确认
    function send_post0(url, info) {
        $.post(url, info, function (result) {
            var body = $("#tbody1");
            body.empty();
            var fenye = $(".fenye1");
            fenye.empty();
            var html = "";
            for (var i = 0; i < result.dataList.length; i++) {
                html += "<tr class='yonghu_sj'>";
                html += "<td>" + result.dataList[i].recipient + "</td>";
                html += "<td>" + result.dataList[i].contact.substring(0, 12) + "</td>";

                if (result.dataList[i].createtime != "" && result.dataList[i].createtime != undefined) {
                    var time = new Date(result.dataList[i].createtime);
                    result.dataList[i].createtime = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
                }
                else {
                    result.dataList[i].createtime = "";
                }

                html += "<td>" + result.dataList[i].createtime + "</td>";
                html += "<td><a href='/admin/phone/detail/" + result.dataList[i].sequence + "'>";
                html += "<div class='xiangqing'>";
                html += "<img src='/backpage/images/xiangqingtb.png' width='25'height='25' style='position: relative;top: -4px;'/>";
                html += "</div>";
                html += "</a></td>";
                html += "</tr>";
            }//订单结束
            //分页
            var html2 = "";
            html2 += "<div class='fenye1'>";
            html2 += "<a class='previous sure'>";
            html2 += "<div class='sx_ys'>上一页</div>";
            html2 += "</a>";
            html2 += "<div class='zj_xl'>";
            html2 += "<select class='pg sure' all='"+result.pages+"'>";
            html2 += "<a class='previous sure'>";
            for ( var s=1 ; s<=result.pages ; s++ )
            {
                html2 += "<option value='"+s+"' >第 "+s+" 页</option>" ;
            }
            html2 += "</select>";
            html2 += "</div>";
            html2 += "<a class='next sure'>";
            html2 += "<div class='sx_ys'>下一页</div>";
            html2 += "</a>";
            html2 += "</div>";

            body.append(html);
            fenye.append(html2);
            afterLoad0();
        }, "json");
    }

    //待付款
    function send_post1(url, info) {
        $.post(url, info, function (result) {
            var body = $("#tbody2");
            body.empty();
            var fenye = $(".fenye2");
            fenye.empty();
            var html = "";
            for (var i = 0; i < result.dataList.length; i++) {
                html += "<tr class='yonghu_sj'>";
                html += "<td>" + result.dataList[i].recipient + "</td>";
                html += "<td>" + result.dataList[i].contact.substring(0, 12) + "</td>";

                if (result.dataList[i].createtime != "" && result.dataList[i].createtime != undefined) {
                    var time = new Date(result.dataList[i].createtime);
                    result.dataList[i].createtime = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
                }
                else {
                    result.dataList[i].createtime = "";
                }

                html += "<td>" + result.dataList[i].createtime + "</td>";
                html += "<td><a href='/admin/phone/detail/" + result.dataList[i].sequence + "'>";
                html += "<div class='xiangqing'>";
                html += "<img src='/backpage/images/xiangqingtb.png' width='25'height='25' style='position: relative;top: -4px;'/>";
                html += "</div>";
                html += "</a></td>";
                html += "</tr>";
            }//订单结束
            //分页
            var html2 = "";
            html2 += "<div class='fenye1'>";
            html2 += "<a class='previous pay'>";
            html2 += "<div class='sx_ys'>上一页</div>";
            html2 += "</a>";
            html2 += "<div class='zj_xl'>";
            html2 += "<select class='pg pay' all='"+result.pages+"'>";
            html2 += "<a class='previous pay'>";
            for ( var s=1 ; s<=result.pages ; s++ )
            {
                html2 += "<option value='"+s+"' >第 "+s+" 页</option>" ;
            }
            html2 += "</select>";
            html2 += "</div>";
            html2 += "<a class='next pay'>";
            html2 += "<div class='sx_ys'>下一页</div>";
            html2 += "</a>";
            html2 += "</div>";

            body.append(html);
            fenye.append(html2);
            afterLoad1();
        }, "json");
    }

    //待发货
    function send_post2(url, info) {
        $.post(url, info, function (result) {
            var body = $("#tbody3");
            body.empty();
            var fenye = $(".fenye3");
            fenye.empty();
            var html = "";
            for (var i = 0; i < result.dataList.length; i++) {
                html += "<tr class='yonghu_sj'>";
                html += "<td>" + result.dataList[i].recipient + "</td>";
                html += "<td>" + result.dataList[i].contact.substring(0, 12) + "</td>";

                if (result.dataList[i].createtime != "" && result.dataList[i].createtime != undefined) {
                    var time = new Date(result.dataList[i].createtime);
                    result.dataList[i].createtime = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
                }
                else {
                    result.dataList[i].createtime = "";
                }

                html += "<td>" + result.dataList[i].createtime + "</td>";
                html += "<td><a href='/admin/phone/detail/" + result.dataList[i].sequence + "'>";
                html += "<div class='xiangqing'>";
                html += "<img src='/backpage/images/xiangqingtb.png' width='25'height='25' style='position: relative;top: -4px;'/>";
                html += "</div>";
                html += "</a></td>";
                html += "</tr>";
            }//订单结束
            //分页
            var html2 = "";
            html2 += "<div class='fenye1'>";
            html2 += "<a class='previous send'>";
            html2 += "<div class='sx_ys'>上一页</div>";
            html2 += "</a>";
            html2 += "<div class='zj_xl'>";
            html2 += "<select class='pg send' all='"+result.pages+"'>";
            html2 += "<a class='previous send'>";
            for ( var s=1 ; s<=result.pages ; s++ )
            {
                html2 += "<option value='"+s+"' >第 "+s+" 页</option>" ;
            }
            html2 += "</select>";
            html2 += "</div>";
            html2 += "<a class='next send'>";
            html2 += "<div class='sx_ys'>下一页</div>";
            html2 += "</a>";
            html2 += "</div>";

            body.append(html);
            fenye.append(html2);
            afterLoad2();
        }, "json");
    }

    //已取消
    function send_post3(url, info) {
        $.post(url, info, function (result) {
            var body = $("#tbody4");
            body.empty();
            var fenye = $(".fenye4");
            fenye.empty();
            var html = "";
            for (var i = 0; i < result.dataList.length; i++) {
                html += "<tr class='yonghu_sj'>";
                html += "<td>" + result.dataList[i].recipient + "</td>";
                html += "<td>" + result.dataList[i].contact.substring(0, 12) + "</td>";

                if (result.dataList[i].createtime != "" && result.dataList[i].createtime != undefined) {
                    var time = new Date(result.dataList[i].createtime);
                    result.dataList[i].createtime = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
                }
                else {
                    result.dataList[i].createtime = "";
                }

                html += "<td>" + result.dataList[i].createtime + "</td>";
                html += "<td><a href='/admin/phone/detail/" + result.dataList[i].sequence + "'>";
                html += "<div class='xiangqing'>";
                html += "<img src='/backpage/images/xiangqingtb.png' width='25'height='25' style='position: relative;top: -4px;'/>";
                html += "</div>";
                html += "</a></td>";
                html += "</tr>";
            }//订单结束
            //分页
            var html2 = "";
            html2 += "<div class='fenye1'>";
            html2 += "<a class='previous cancel'>";
            html2 += "<div class='sx_ys'>上一页</div>";
            html2 += "</a>";
            html2 += "<div class='zj_xl'>";
            html2 += "<select class='pg cancel' all='"+result.pages+"'>";
            html2 += "<a class='previous cancel'>";
            for ( var s=1 ; s<=result.pages ; s++ )
            {
                html2 += "<option value='"+s+"' >第 "+s+" 页</option>" ;
            }
            html2 += "</select>";
            html2 += "</div>";
            html2 += "<a class='next cancel'>";
            html2 += "<div class='sx_ys'>下一页</div>";
            html2 += "</a>";
            html2 += "</div>";

            body.append(html);
            fenye.append(html2);
            afterLoad3();
        }, "json");
    }

    //后续绑定
    function afterLoad0() {

        $(".previous.sure").click(function () {  //上一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) - 1;

            console.log("now1:"+now);
            if(now<=0)
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 0, shopStatus: 0};	//未确认
                var url = "/order/getAdminOrderOnline";
                send_post0(url,info);
            }

        });

        $(".next.sure").click(function () {  //下一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) + 1;

            console.log("now2:"+now);

            if( now > $(".pg.sure").attr("all") )
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 0, shopStatus: 0};	//未确认
                var url = "/order/getAdminOrderOnline";
                send_post0(url,info);
            }


        });

        $(".pg.sure").change(function () {
            var now = $(".pg.sure option:selected").val();
            console.log(now);
            var info = {pageNo: now, pageSize: 10, orderStatus: 0, shopStatus: 0};	//未确认
            var url = "/order/getAdminOrderOnline";
            send_post0(url,info);
        });

    }

    function afterLoad1() {


        $(".previous.pay").click(function () {  //上一页
            //console.log(now);
            var now = $(".pg.sure option:selected").val();
            now = parseInt(now) - 1;
            if(now<=0)
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 0};	//待付款
                var url = "/order/getAdminOrderOnline";
                send_post1(url,info);
            }

        });

        $(".next.pay").click(function () {  //下一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) + 1;
            if( now > $(".pg.pay").attr("all") )
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 0};	//待付款
                var url = "/order/getAdminOrderOnline";
                send_post1(url,info);
            }


        });

        $(".pg.pay").change(function () {
            var now = $(".pg.sure option:selected").val();
            console.log(now);
            var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 0};	//待付款
            var url = "/order/getAdminOrderOnline";
            send_post1(url,info);
        });

    }

    function afterLoad2() {


        $(".previous.send").click(function () {  //上一页
            //console.log(now);
            var now = $(".pg.sure option:selected").val();
            now = parseInt(now) - 1;
            if(now<=0)
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 1};	//待发货
                var url = "/order/getAdminOrderOnline";
                send_post1(url,info);
            }

        });

        $(".next.send").click(function () {  //下一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) + 1;
            if( now > $(".pg.send").attr("all") )
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 1};	//待发货
                var url = "/order/getAdminOrderOnline";
                send_post1(url,info);
            }


        });

        $(".pg.send").change(function () {
            var now = $(".pg.sure option:selected").val();
            console.log(now);
            var info = {pageNo: now, pageSize: 10, orderStatus: 1, shopStatus: 1};	//待发货
            var url = "/order/getAdminOrderOnline";
            send_post1(url,info);
        });

    }

    function afterLoad3() {

        $(".previous.cancel").click(function () {  //上一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) - 1;
            if(now<=0)
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 8};	//已取消
                var url = "/order/getAdminOrderOnline";
                send_post3(url,info);
            }

        });

        $(".next.cancel").click(function () {  //下一页
            var now = $(".pg.sure option:selected").val();
            //console.log(now);
            now = parseInt(now) + 1;
            if( now > $(".pg.cancel").attr("all") )
            {
                return false;
            }
            else {
                var info = {pageNo: now, pageSize: 10, orderStatus: 8};	//已取消
                var url = "/order/getAdminOrderOnline";
                send_post3(url,info);
            }


        });

        $(".pg.cancel").change(function () {
            var now = $(".pg.sure option:selected").val();
            console.log(now);
            var info = {pageNo: now, pageSize: 10, orderStatus: 8};	//已取消
            var url = "/order/getAdminOrderOnline";
            send_post3(url,info);
        });

    }

</script></body></html>
